/*
 * Copyright 2011 Angel Sanadinov
 *
 * This file is part of VBox WMI.
 *
 * VBox WMI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VBox WMI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VBox WMI.  If not, see <http://www.gnu.org/licenses/>.
 */

package Utilities;

/**
 * This class represents the exception messages used by the system. <br><br>
 * Usually, these are messages returned to the client as responses to an operation
 * and are not used for logging information.
 *
 * @author Angel Sanadinov
 */
public class ExceptionMessages
{
    public static final int APP_E_UNKNOWN_EXCEPTION = 0;
    public static final int APP_E_MULTIPLE_EXCEPTIONS = 1;
    public static final int APP_E_INVALID_REQUESTED_ACTION = 2;
    public static final int APP_E_OPERATION_NOT_ALLOWED = 3;
    public static final int APP_E_INVALID_REQUEST = 4;
    public static final int APP_E_USER_RETRIEVAL_FAILED = 5;
    public static final int APP_E_RESOURCES_RETRIEVAL_FAILED = 6;
    public static final int APP_E_REQUESTOR_AUTHENTICATION_FAILED = 7;
    public static final int APP_E_SERVER_RETRIEVAL_FAILED = 8;
    public static final int APP_E_LOGS_RETRIEVAL_FAILED = 9;
    public static final int APP_E_VBOX_REF_NOT_AVAILABLE = 10;
    public static final int APP_E_MACHINES_RETRIEVAL_FAILED = 11;
    public static final int APP_E_MEDIUM_RETRIEVAL_FAILED = 12;
    public static final int APP_E_MEDIA_RETRIEVAL_FAILED = 13;
    public static final int APP_E_NETWORK_TYPE_INVALID = 14;
    public static final int APP_E_NETWORKS_RETRIEVAL_FAILED = 15;
    public static final int APP_E_MISC_DATA_RETRIEVAL_FAILED = 16;
    public static final int APP_E_CREDENTIALS_VERIFICATION_FAILED = 17;
    public static final int APP_E_SESSION_SETUP_FAILED = 18;
    public static final int APP_E_INVALID_CREDENTIALS = 19;
    public static final int APP_E_USER_EXISTS = 20;
    public static final int APP_E_DATABASE_EXCEPTION = 21;
    public static final int APP_E_USER_CREATION_FAILED = 22;
    public static final int APP_E_USER_MODIFICATION_FAILED = 23;
    public static final int APP_E_USER_REMOVAL_FAILED = 24;
    public static final int APP_E_USER_PASSWORD_RESET_FAILED = 25;
    public static final int APP_E_USER_PERMISSIONS_EXIST = 26;
    public static final int APP_E_USER_PERMISSIONS_REMOVAL_FAILED = 27;
    public static final int APP_E_USER_PERMISSIONS_MODIFICATION_FAILED = 28;
    public static final int APP_E_SERVER_EXISTS = 29;
    public static final int APP_E_SERVER_MODIFICATION_FAILED = 30;
    public static final int APP_E_SERVER_REMOVAL_FAILED = 31;
    public static final int APP_E_MEDIUM_INVALID_REQUESTED_ACTION = 32;
    public static final int APP_E_PROGRESS_OBJECT_RETRIEVAL_FAILED = 33;
    public static final int APP_E_HARD_DISK_EXISTS_IN_DB = 34;
    public static final int APP_E_MEDIUM_EXISTS_IN_DB = 35;
    public static final int APP_E_DEVICE_IS_NOT_MEDIUM = 36;
    public static final int APP_E_MEDIUM_PERMISSIONS_UPDATE_FAILED = 37;
    public static final int APP_E_MEDIUM_NOT_BASE = 38;
    public static final int APP_E_MEDIUM_OWNER_UPDATE_FAILED = 39;
    public static final int APP_E_MEDIUM_SOURCE_REMOVAL_FAILED = 40;
    public static final int APP_E_MEDIUM_REMOVAL_FAILED = 41;
    public static final int APP_E_HOST_RETRIEVAL_FAILED = 42;
    public static final int APP_E_HOST_ONLY_UUID_RETRIEVAL_FAILED = 43;
    public static final int APP_E_NETWORK_EXISTS_IN_DB = 44;
    public static final int APP_E_HOST_ONLY_IF_REMOVAL_FAILED = 45;
    public static final int APP_E_NETWORK_PERMISSIONS_UPDATE_FAILED = 46;
    public static final int APP_E_NETWORK_OWNER_UPDATE_FAILED = 47;
    public static final int APP_E_DHCP_OBJECT_RETRIEVAL_FAILED = 48;
    public static final int APP_E_DHCP_NETWORK_NAME_RETRIEVAL_FAILED = 49;
    public static final int APP_E_DHCP_AVAILABILITY_UPDATE_FAILED = 50;
    public static final int APP_E_NETWORK_EXTERNAL_NAME_UPDATE_FAILED = 51;
    public static final int APP_E_NETWORK_ATTACHED_NICS_RETRIEVAL_FAILED = 52;
    public static final int APP_E_NETWORK_MACHINES_ARE_ATTACHED = 53;
    public static final int APP_E_NETWORK_RETRIEVAL_FAILED = 54;
    public static final int APP_E_INTERNAL_NETWORK_REMOVAL_FAILED = 55;
    public static final int APP_E_DISPATCHER_RETRIEVAL_FAILED = 56;
    public static final int APP_E_MACHINE_EXISTS_IN_DB = 57;
    public static final int APP_E_MACHINE_NETWORK_ATTACHMENT_NOT_ALLOWED = 58;
    public static final int APP_E_MACHINE_MEDIUM_ATTACHMENT_NOT_ALLOWED = 59;
    public static final int APP_E_MACHINE_STORAGE_ATTACHMENT_FAILED = 60;
    public static final int APP_E_MACHINE_REMOVE_NOT_ALLOWED = 61;
    public static final int APP_E_MACHINE_REMOVAL_FAILED = 62;
    public static final int APP_E_MACHINE_SESSION_OPEN = 63;
    public static final int APP_E_MACHINE_IN_INVALID_STATE = 64;
    public static final int APP_E_MACHINE_PERMISSIONS_UPDATE_FAILED = 65;
    public static final int APP_E_MACHINE_OWNER_UPDATE_FAILED = 66;
    public static final int APP_E_MACHINE_STATE_CHANGE_FAILED = 67;
    public static final int APP_E_MACHINE_REQUESTED_INVALID_STATE = 68;
    public static final int APP_E_MACHINE_INVALID_SNAPSHOT_ACTION = 69;
    public static final int APP_E_MACHINE_SNAPSHOT_OPERATION_FAILED = 70;
    public static final int APP_E_REQUEST_SEND_FAILED_INVALID_HTTP_DATA = 71;
    public static final int APP_E_REQUEST_SEND_FAILED_INVALID_REQUEST = 72;
    public static final int APP_E_REQUEST_SEND_FAILED_INVALID_SERVICE = 73;
    public static final int APP_E_REQUEST_SEND_FAILED_INVALID_DISPATCHER = 74;

    /**
     * An array containing all the exception message strings. <br>
     * A message can be retrieved by using the appropriate <code>APP_E</code>
     * constant as an index for the array.
     */
    public static final String[] exceptionMessages =
    {"An unknown exception has occurred.",           //0
    "Multiple exceptions have occurred, check exceptions list for more information.",
    "The requested action is invalid.",             //2
    "The requested operation is not allowed.",      //3
    "The supplied request data is invalid.",        //4
    "Failed to retrieve data for user with ID: ",   //5
    "Failed to retrieve resources.",                //6
    "Failed to authenticate requestor.",            //7
    "Failed to retrieve data for server with ID: ", //8
    "Failed to retrieve logs data: ",               //9
    "Failed to connect to VirtualBox server.",      //10
    "Failed to retrieve machines data.",            //11
    "Failed to retrieve medium data.", //12
    "Failed to retrieve media data.",               //13
    "Requested network type is invalid.",           //14
    "Failed to retrieve networks data.",            //15
    "Failed to retrieve miscellaneous data.",       //16
    "Unable to verify user credentials.",           //17
    "Failed to setup user session.",                //18
    "Invalid username and/or password.",            //19
    "User creation failed, user exists: ",          //20
    "An unspecified database exception has occurred: ", //21
    "User creation failed.",                        //22
    "User modification failed: ",                   //23
    "User removal failed: ",                        //24
    "Failed to reset user password: ",              //25
    "Permissions already exist for user: ",         //26
    "Failed to remove permissions for user: ",      //27
    "Failed to modify permissions for user: ",      //28
    "A server with the specified service address exists: ", //29
    "Modification failed of server with ID: ",      //30
    "Removal failed of server with ID: ",           //31
    "The requested medium action is invalid",       //32
    "Failed to retrieve progress object",           //33
    "A hard disk with matching UUID already exists in "              //34
     + "the database. The new disk will be closed but not removed.",//34
    "A medium with matching UUID already exists in the database.",  //35
    "The requested device type is not a medium.",   //36
    "Failed to update medium permissions.",         //37
    "Modifications can be done only on base media.",//38
    "Failed to update medium owner.",               //39
    "Failed to remove source medium.",              //40
    "Failed to remove medium from the database.",   //41
    "Host data object retrieval failed.",           //42
    "Failed to retrieve Host-Only interface UUID.", //43
    "A network with matching UUID already exists in the database.", //44
    "Failed to remove Host-Only interface from the database.",      //45
    "Failed to update network permissions.",        //46
    "Failed to update network owner.",              //47
    "Failed to retrieve DHCP server object.",       //48
    "Failed to retrieve network name.",             //49
    "Failed to update DHCP server availability.",   //50
    "Failed to update network's external name.",    //51
    "Failed to retrieve the number of NICs attached to the network.",//52
    "One or more machines are attached to the internal network.",    //53
    "Failed to retrieve network from the database.",//54
    "Failed to remove internal network from the database.",          //55
    "Failed to retrieve dispatcher for service: ",  //56
    "A machine with matching UUID already exists in the database.",  //57
    "Network attachment not allowed for network: ", //58
    "Medium attachment not allowed for medium: ",   //59
    "Storage attachment failed: ",                  //60
    "Machine has snapshots or is in an invalid state",      //61
    "Failed to remove virtual machine from the database.",  //62
    "The virtual machine has an open or opening session.",  //63
    "The virtual machine is in invalid state: ",    //64
    "Failed to update virtual machine permissions.",//65
    "Failed to update virtual machine owner.",      //66
    "State change failed: ",                        //67
    "The requested state change is invalid: ",      //68
    "Invalid snapshot action requested: ",          //69
    "The requested snapshot operation failed: ",           //70
    "Invalid HTTP request/response supplied to sending method.",//71
    "Invalid data was supplied for the request.",   //72
    "Invalid management service was requested.",    //73
    "Failed to retrieve service dispatcher."};      //74

    private ExceptionMessages(){}
}
